/**  
 * All rights Reserved, Designed By Android_Robot   
 * @Title:  HuoDongChatRowProvider.java   
 * @Package com.jiyi.easemob.widget   
 * @Description:    TODO(用一句话描述该文件做什么)   
 * @author: HYM     
 * @date:   2017-7-5 上午11:13:09   
 * @version V1.0     
 */
package com.jiyi.easemob.widget;

import android.content.Context;
import android.widget.BaseAdapter;

import com.hyphenate.chat.EMMessage;
import com.hyphenate.easeui.widget.chatrow.EaseChatRow;
import com.hyphenate.easeui.widget.chatrow.EaseCustomChatRowProvider;

public class HuoDongChatRowProvider implements EaseCustomChatRowProvider {
	Context context;

	public HuoDongChatRowProvider(Context context) {
		this.context = context;
	}

	@Override
	public int getCustomChatRowTypeCount() {
		return 2;
	}

	@Override
	public int getCustomChatRowType(EMMessage message) {
		return message.direct() == EMMessage.Direct.RECEIVE ? 1 : 2;
	}

	@Override
	public EaseChatRow getCustomChatRow(EMMessage message, int position,
			BaseAdapter adapter) {
		if(message.getType().toString().equals("14")){
			return new EaseChatRowHuoDong(context, message, position, adapter);
        }
        return null;
		
	}
}
